package hiatao.puzzle.activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.Window;

import haitao.puzzle.R;
import hiatao.puzzle.utils.StatusBarCompat;
/**
 * @author miss
 * 
 */
public class WelcomeActivity extends Activity {
    
	public Context mContext;
	//程序是否使用过
	private boolean isUse=true;
	private View root_layout;
	@Override
	protected void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		this.requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_welcome);
		root_layout =findViewById(R.id.root_layout);
		mContext = WelcomeActivity.this;
		if ( Build.VERSION.SDK_INT >=11){
			root_layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
		}
		StatusBarCompat.compat(this, Color.parseColor("#00000000"));
		if (!isUse) {
			new Handler().postDelayed(new Runnable() {

				@Override
				public void run() {
					/**
                     * 
                     */
					Intent intent = new Intent(WelcomeActivity.this, MainActivity.class);
					startActivity(intent);
					finish();
				}
			}, 1200);
		} else {
			new Handler().postDelayed(new Runnable() {

				@Override
				public void run() {
                    /**
                     * 
                     */
					//openActivity(YixinMainActivity.class);
					Intent intent = new Intent();
					intent.setClass(WelcomeActivity.this,MainActivity.class);
					startActivity(intent);
					finish();
				}
			}, 1200);
		}
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}

	@Override
	protected void onPause() {
		super.onPause();
	}

}
